//
//  MytextField.m
//  ProjectForA
//
//  Created by hmengwei on 14/11/22.
//  Copyright (c) 2014年 hmengwei. All rights reserved.
//

#import "MytextField.h"
#import "MainViewController.h"
@implementation MytextField

- (void)dealloc
{
    [super dealloc];
    
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UITextField *select = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
        [select setBorderStyle:UITextBorderStyleRoundedRect];
        [select setPlaceholder:@"搜索目的地、旅程"];
        [self addSubview:select];
     
    }
    return self;
}


-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    
}

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    MainViewController *main = [[MainViewController alloc] init];
    [UIView beginAnimations:@"ad" context:nil];
    [UIView setAnimationRepeatCount:1];
    [UIView setAnimationDuration:1];
    [main.collection setFrame:CGRectMake(0 , 0, main.view.frame.size.width,main.view.frame.size.height / 2)];
    [UIView commitAnimations];
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
